<?php
if ( ! defined('BASEPATH')) exit('No direct script access allowed');

/**
 * 滚动图片
 * @author huangtq
 * @date 2017-8-28
 */
class Manager_Model extends AR_Model {
    
	protected $_tb = 't_manager';
    
    public function __construct() {
    	parent::__construct();
    }
    
    /**
     * 首页滚动图片
     * type 1 首页
     */
    public function get_list_ad($where='',$select='*',$orderby = '',$array=true){
    	if($where) $this->db->where($where,'',false);
    	if($select) $this->db->select($select);
    	if($orderby) $this->db->order_by($orderby);
    	$query = $this->db->get($this->_tb);
    	if($array) return $query->result_array();
    	else return $query->result();
    }
    
    public function getTotal($where='')
    {
    	if($where) $this->db->where($where);
    	$this->db->from($this->_tb);
    	return $this->db->count_all_results();
    }
}